package com.ztools.common.model.pc;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author: seeTools
 * @Date: 2023/5/12  16:33
 * @Version 1.0
 */
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
public class BaseModel implements Serializable {

    /**
     * 创建人ID
     */
    @TableField(fill = FieldFill.INSERT, value = "creator_id")
    private Long creatorId;

    /**
     * 创建人名称
     */
    @TableField(fill = FieldFill.INSERT, value = "creator_name")
    private String creatorName;

    /**
     * 创建时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT, value = "created_date")
    private Date createdDate;

    /**
     * 编辑人ID
     */
    @TableField(fill = FieldFill.INSERT_UPDATE, value = "modifier_id")
    private Long modifierId;

    /**
     * 编辑人名称
     */
    @TableField(fill = FieldFill.INSERT_UPDATE, value = "modifier_name")
    private String modifierName;

    /**
     * 编辑时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE, value = "modified_date")
    private Date modifiedDate;

    /**
     * 数据有效标识
     */
    @TableLogic(value = "1", delval = "0")
    @TableField(value = "active")
    private Integer active;

    /**
     * 备注信息
     */
    private String remark;

    /**
     * 版本号
     */
    @Version
    private Integer version;


}
